<?php
//
// +------------------------------------------------------------------------+
// | PHP Version 5.4                                                        |
// +------------------------------------------------------------------------+
// | Copyright (c) All rights reserved.                                     |
// +------------------------------------------------------------------------+
// | 世纪车来车往(北京）网络科技有限公司 版权所有！                         |
// | TEL:010-63732365  HOTLINE:400-6688-365  EMAIL:clcw@clcw.com.cn         |
// | $Revision: 1.0 $                                                       |
// +------------------------------------------------------------------------+
// | Author: songaimin@clcw.com.cn  Blog:http://blog.csdn.net/samxx8        |
// +------------------------------------------------------------------------+
//
namespace AuctionCore\Other;
use AuctionCore\System\AuctionException;

/**
* 兴趣功能类
* @author       Eric Lee
*/
class Interest{
    private $dealer_id = null;
    /**
    * 构造
    * @param    int $dealer_id    车商id
    * @return   void
    */
    public function __construct($dealer_id) {
           $this->dealer_id = $dealer_id;
    }
    /**
    * 保存兴趣
     * @param $data array 车商兴趣
    * @return   int
    */
    public function save($data) {
          $data['dealer_id'] = $this->dealer_id;
          M('dealer_interest')->where("dealer_id='".$this->dealer_id."'")->delete();
          return M('dealer_interest')->add($data);
    }
    

    /**
    * 获取兴趣详细
    * @return   Array
    */
    public function detail() {
           return m('dealer_interest')->where("dealer_id='".$this->dealer_id."'")->find();
    }
}

?>